﻿using Refit;
using System;
using System.Collections.Generic;
using System.Text;

namespace Asion.RPC
{
    /// <summary>
    /// rp api 服务
    /// </summary>
    public class RpcApiService
    {

        /// <summary>
        /// 获取client 客户端
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static T GetClient<T>() where T : IRpcApi
        {
            //这里要知道服务器的地址，服务器的地址是通过配置文件来配置的
            return RestService.For<T>(RpcRegistry.GetRpcDefaultApi(typeof(T).FullName));
        }
    }
}
